Skip to content

Fix bug where immutable entities bypass memoization index during batch processing#6083

Merged
incrypto32 merged 1 commit intomasterfrom
krishna/memoization-bug
Jul 24, 2025
Merged

Fix bug where immutable entities bypass memoization index during batch processing#6083
incrypto32 merged 1 commit intomasterfrom
krishna/memoization-bug

Conversation

@incrypto32
Copy link
Member

Immutable entities were bypassing our memoization indexing system. Here's what was happening:

  1. Immutable entities were added directly to the batch rows via append_row()
  2. This skipped the memoization index that push_row() normally maintains
  3. When the system later tried to look up these entities, it couldn't find them despite being present in memory
  4. This caused store.get() to return None while the entity existed in cache, triggering assertion panics

Solution

Change append_row() to use self.push_row(row) instead of self.rows.push(row) for immutable entity inserts. This ensures they're properly indexed while preserving the intended performance benefits.

// Before: self.rows.push(row);
// After:  self.push_row(row);

@incrypto32 incrypto32 changed the title Fix bug where immutable entities bypass memoization index during batch processing, causing entity cache consistency assertion failures and subgraph processing panics. Fix bug where immutable entities bypass memoization index during batch processing Jul 23, 2025
@incrypto32 incrypto32 marked this pull request as ready for review July 23, 2025 14:15
@incrypto32 incrypto32 requested a review from isum July 23, 2025 14:16
@incrypto32 incrypto32 merged commit 0e192f8 into master Jul 24, 2025
6 checks passed
@incrypto32 incrypto32 deleted the krishna/memoization-bug branch July 24, 2025 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants